#pragma once
#include <d3d9.h>
#include <d3dx9.h>
#include <dxerr.h>

#if defined(DEBUG) | defined(_DEBUG)
	#ifndef D3D_DEBUG_INFO
		#define D3D_DEBUG_INFO
	#endif
#endif

#define ReleaseCOM(x)				\
{									\
		if(x)						\
		{							\
			x->Release();			\
			x = 0;					\
		}							\
}

#if defined(DEBUG) | defined(_DEBUG)
	#ifndef HR
	#define HR(x)												\
	{															\
		HRESULT hr = x;											\
		if(FAILED(hr))											\
		{														\
			DXTrace(__FILE__, __LINE__, hr, __TEXT(#x), TRUE);	\
		}														\
	}
	#endif
#else
	#ifndef HR
	#define HR(x) x;
	#endif
#endif 